!(function(global,userUtil,layer,dataUtil){   

	//申请记录
	getborrowingInfo();

  var stateConf = {
      1: { text: "申请中", operateTxt: "继续提交" },
      2: { text: "审核中", operateTxt: "审核中" },
      3: { text: "审核通过", operateTxt: "审核通过" },
      4: { text: "待放款(放款处理中)", operateTxt: "待放款" },
      5: { text: "待还款(正常待还款)", operateTxt: "一键还款" },
      6: { text: "已还款(正常已还款)", operateTxt: "再次申请" },
      7: { text: "审核不通过", operateTxt: "再次申请"},
      8: { text: "已逾期(逾期待还款)", operateTxt: "一键还款" },
      9: { text: "逾期已还款", operateTxt: "再次申请" },
      10: { text: "复审拒绝", operateTxt: "复审拒绝" },
      11: { text: "还款处理中", operateTxt: "还款处理中" },
      12: { text: "放款失败", operateTxt: "放款失败" },      
  };
	function getborrowingInfo(){
				userUtil.ajax({
					url: global.localUrl+ 'wallet/orders/borrowingInfo',
					data:{"userUuid" : localStorage.getItem("userID")},
					done: function(re){
						layer.hideLoad();
			        if(re.data==0){
			          $("#borrowList").html("<div class='orderNone'>暂无订单</div>");
			
			        }
			        var $dom;
					$.each(re.data,function(k,v){
					if(v.status == 1 || v.status == 5 ||  (v.status == 7&&v.orderRemark=="") || v.status == 8){    //有操作按钮            
			             $dom = '<div class="recordContent">'
			                  +'<div class="recordListLeft">'
			                  +'<span class="titleContentLeft"><sup>￥</sup><i class="showNum">'+v.borrowingAmount+'</i><span class="samllText">元</span></span>'
			                  +'<span class="titleContentRight"><i class="showNum">'+v.borrowingTerm+'</i><span class="samllText"></span></span> '         
			                  +'<div class=" titleLeft"> 借款金额</div>'
			                  +'<div class=" titleRight"> 借款期限</div>'
			                  +'</div>'
			                  +'<div class="recordListRight">'
			                  +'<div class="recordListBtnBottom1">'
			                  +'<a data-status='+v.status+' class="fastRepay">'+stateConf[v.status].operateTxt+'</a>'
			                  +'</div>'
			                  +'</div>'
			                  +'<div class="recordListBottom" data-uuid='+v.orderNo+'>'
			                  +'<ul class="tipsInfo">'
			                  +'<li>申请时间：<span>'+v.createTime+'</span></li>'
			                  +'<li>申请编号：<span>'+v.orderNo+'</span></li>'
			                  +'</ul>'
			                  +'<img class="tipsImg1" />'
			                  +'</div></div> '
			        }else{
			                  $dom = '<div class="recordContent ">'
			                  +'<div class="recordListLeft">'
			                  +'<span class="titleContentLeft"><sup>￥</sup><i class="showNum">'+v.borrowingAmount+'</i><span class="samllText">元</span></span>'
			                  +'<span class="titleContentRight"><i class="showNum">'+v.borrowingTerm+'</i><span class="samllText"></span></span> '         
			                  +'<div class=" titleLeft"> 借款金额</div>'
			                  +'<div class=" titleRight"> 借款期限</div>'
			                  +'</div>'
			                  +'<div class="recordListRight">'
			                  +'<div class="recordListBtnBottom" data-status='+v.status+'>'
			                  +'<a class="">'+stateConf[v.status].operateTxt+'</a>'
			                  +'</div>'
			                  +'</div>'
			                  +'<div class="recordListBottom" data-uuid='+v.orderNo+'>'
			                  +'<ul class="tipsInfo">'
			                  +'<li>申请时间：<span>'+v.createTime+'</span></li>'
			                  +'<li>申请编号：<span>'+v.orderNo+'</span></li>'
			                  +'</ul>'
			                  +'<img class="tipsImg2" />'
			                  +'</div></div> '        
			        }
			        $("#borrowList").append($dom);
		            if(v.status == 1){
		            	$('.recordListBtnBottom1 a').addClass('Reapplay');
		            	$('.recordListBtnBottom1 a').attr('href','../trust/identification.html');
		            	$('.tipsImg1').css("opacity","0");
		            }else if(v.status == 5||v.status == 8){
		            	$('.recordListBtnBottom1 a').addClass('fastRepay');
		            	$('.recordListBtnBottom1 a').attr('href','repaymentDetail.html');
		            	$('.tipsImg1').attr("src","../img/tipImg2.png");
		            }else if(v.status == 7&&v.orderRemark !=""){
		            	$('.recordListBtnBottom a').addClass('Reapplay');
		            	$('.recordListBtnBottom a').attr('href','../index.html');
		            	$('.tipsImg2').attr("src","../img/tipImg1.png");
		            }else if(v.status == 6||v.status == 9){
		            	$('.recordListBtnBottom a').addClass('repayFast');
		            	$('.recordListBtnBottom a').attr('href','../index.html');
		            	$('.tipsImg2').attr("src","../img/tipImg3.png");		            	
		            }else if(v.status == 12&&v.flag == false){
		            	$('.recordListBtnBottom a').css('opacity','0');
		            	$('.tipsImg').replaceWith("<span class='tipsTxt'>银行卡绑定错误，请更换！</span>");
		            }else if(v.status == 12){
		            	$('.recordListBtnBottom a').css('opacity','1');           	
		            }
				});
			}
		})
	}


})(global,userUtil,layer,dataUtil)